<?php

namespace app\move\controller;

use app\common\model\Consult;
use app\common\model\ConsultBanner;
use app\index\logic\ArticleLogic;

class Article extends Base
{

    public function index()
    {
        $banner = ConsultBanner::field('id,title,click_url,img')->where(['state' => 1])->order('sort,id desc')->select();
        $lists = Consult::order('sort asc,id desc')->select();
        $this->assign('banner', $banner);
        $this->assign('list', $lists);
        $this->assign('web_title', '资讯中心');
        return $this->fetch();
    }


    public function info($id = 3)
    {
        $r = (new ArticleLogic())->info($id);
        $this->assign('web_title', '资讯详情');
        $this->assign('info', $r['info']);
        $this->assign('consult', $r['consult']);
        $this->assign('list', $r['list']);
        return $this->fetch("article/detail");
    }

}